import * as THREE from 'three';

// 创建一个空的几何体对象
const geometry = new THREE.BufferGeometry();

const vertices = new Float32Array([
    0, 0, -20,
    -400, 0, -20,
    -400, 400, -20,
    0, 400, -20,
    0, 0, -20,
    -400, 400, -20
])

// 使用缓存对象表示顶点数据
const attribute = new THREE.BufferAttribute(vertices, 3);

// 设置几何体的顶点位置属性
geometry.attributes.position = attribute;

// 定义网格模型材质
const material = new THREE.MeshBasicMaterial({
    color: 0x007788,
    size: 10,
    // 背面可见
    side: THREE.BackSide,
})

// 定义网格模型对象
const mesh = new THREE.Mesh(geometry, material);

export default mesh;